package information.details;

import javax.swing.JLabel;
import javax.swing.JTextField;

public class StorageDetails extends AbstractDetails{


	private static final long serialVersionUID = 1L;

	public StorageDetails(int width) {
		super(width);
	
		this.setTitle("Info om plassering");
	
		this.setupLabelArray();
		this.createTextFieldArray();
	}
	
	public void setDescription(Object data) {
		this.setPrimaryTextAt(6, data);
	}
	
	@Override
	protected void setupLabelArray() {
		JLabel[] labels = {
				new JLabel("Navn: "),
				new JLabel("Adresse: "),
				new JLabel("Postnummer: "),
				new JLabel("Sted: "),
				new JLabel("Telefon: "),
				new JLabel("E-Mail: "),
				new JLabel("Beskrivelse: ")
			};
			
			this.addLabels(labels);
	}
	
	@Override
	protected void createTextFieldArray() {
		this.setupTextFields(new JTextField[7]);
	}
	
	public void populateDetails(Object[][] data) {
		this.setAllPrimaryTexts(data[0]);
	}
}
